/***
 * 
 */
define( [ 'Vue', 'axios' ], function ( Vue, axios ) {
    return Vue.component('MethodRef', {
        props: ['host', 'port', 'method'],

        data: function() {
            return {
                methodList: []
            };
        },

        mounted : function () {
            var _this = this;

            axios.get( 'spring-method.json?method=' + this.method + '&host=' + this.host +'&port=' +this.port ) .then(function (response) {
                if ( 'string' == typeof response.data.Content ) {
                    return;
                }

                _this.methodList = response.data.Content;
            });
        },

        template : `
            <div :title="JSON.stringify(methodList)">
                <b v-if="methodList.length > 0" style="color:red;">{{methodList.length}}</b>
                <span v-else>{{methodList.length}}</span>
            </div>
        `
    });
});